package com.anhry.app.safety.manage.oa.bean;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.anhry.app.safety.manage.enterprise.bean.TbCorpInfo;
import com.anhry.app.safety.manage.system.bean.TbUser;

/**
 * 
 * @author chen
 * @date 2012-8-20
 */
@Entity
@Table(name="TB_OA_CALL_MSG")
@SequenceGenerator(name="TB_OA_CALL_MSG_SEQ", sequenceName="TB_OA_CALL_MSG_SEQ_DB", allocationSize=1)
public class TbOaCallMsg implements java.io.Serializable {

	// Fields

	private Long id;

	private String msgTitle;// 消息标题

	private String msgContent;// 消息内容

	private Date msgTime;// 消息发送时间
	// private String msgUser;
	// private String addsUser;

	private TbUser msgUser;// 消息发送人

	private TbUser tbUser;// 消息接收人

	private TbCorpInfo tbCorpInfo;// 企业接收者
	// private String addsCorp;

	private String userTypes;// 接收者类型0：管理员1：企业

	private String msgType;// 消息类型0：个人1：系统

	private String isRead;// 是否阅读0：未读1：已读

	private Date readTime;// 阅读时间

	private String noteNum;// 已发短信条数

	private String noteNums;// 应发短信条数

	private String noteAtTime;// 短信发送间隔时间（分钟）

	private Date noteTime;// 最后一次发送短信时间

	private String eventType;// 事件类型1：企业分类分级2：企业复查3：特种设备检测4：企业自查自报0：其他

	private String isDele;//

	private String version;//

	private TbOaPersonCall tbPersonCall;//

	private String callType;// 提醒机制0：信息1：手机短信2：信息+手机短信

	private String isCorper;// 接收人如为企业时：0：负责人1：安全负责人

	private String msgYear;//

	private String msgQuarter;//

	private String msgMonth;//

	// Constructors

	/** default constructor */
	public TbOaCallMsg() {
	}

	/** full constructor */
	public TbOaCallMsg(String msgTitle, String msgContent, Date msgTime,
			TbUser msgUser, TbUser tbUser, TbCorpInfo tbCorpInfo,
			String userTypes, String msgType, String isRead, Date readTime,
			String noteNum, String callType, String isCorper, String noteNums,
			String noteAtTime, Date noteTime, TbOaPersonCall tbPersonCall,
			String eventType, String isDele, String version) {
		this.msgTitle = msgTitle;
		this.msgContent = msgContent;
		this.msgTime = msgTime;
		this.msgUser = msgUser;
		this.tbUser = tbUser;
		this.tbCorpInfo = tbCorpInfo;
		this.userTypes = userTypes;
		this.msgType = msgType;
		this.isRead = isRead;
		this.readTime = readTime;
		this.noteNum = noteNum;
		this.noteNums = noteNums;
		this.noteAtTime = noteAtTime;
		this.noteTime = noteTime;
		this.eventType = eventType;
		this.isDele = isDele;
		this.version = version;
		this.callType = callType;
		this.tbPersonCall = tbPersonCall;
		this.isCorper = isCorper;
	}

	// Property accessors

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TB_OA_CALL_MSG_SEQ")
	@Column(name = "ID", precision = 11, scale = 0)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "MSG_TITLE")
	public String getMsgTitle() {
		return this.msgTitle;
	}

	public void setMsgTitle(String msgTitle) {
		this.msgTitle = msgTitle;
	}

	@Column(name = "MSG_CONTENT")
	public String getMsgContent() {
		return this.msgContent;
	}

	public void setMsgContent(String msgContent) {
		this.msgContent = msgContent;
	}

	@Column(name = "MSG_TIME")
	@Temporal(TemporalType.DATE)
	public Date getMsgTime() {
		return this.msgTime;
	}

	public void setMsgTime(Date msgTime) {
		this.msgTime = msgTime;
	}

	@ManyToOne(cascade = { CascadeType.REFRESH }, fetch = FetchType.EAGER)
	@JoinColumn(name = "MSG_USER")
	public TbUser getMsgUser() {
		return msgUser;
	}

	public void setMsgUser(TbUser msgUser) {
		this.msgUser = msgUser;
	}

	@ManyToOne(cascade = { CascadeType.REFRESH }, fetch = FetchType.EAGER)
	@JoinColumn(name = "ADDS_USER")
	public TbUser getTbUser() {
		return tbUser;
	}

	public void setTbUser(TbUser tbUser) {
		this.tbUser = tbUser;
	}

	@ManyToOne(cascade = { CascadeType.REFRESH }, fetch = FetchType.EAGER)
	@JoinColumn(name = "ADDS_CORP")
	public TbCorpInfo getTbCorpInfo() {
		return tbCorpInfo;
	}

	public void setTbCorpInfo(TbCorpInfo tbCorpInfo) {
		this.tbCorpInfo = tbCorpInfo;
	}

	@Column(name="USER_TYPES", length=1)
	public String getUserTypes() {
		return this.userTypes;
	}

	public void setUserTypes(String userTypes) {
		this.userTypes = userTypes;
	}

	@Column(name="MSG_TYPE", length=1)
	public String getMsgType() {
		return this.msgType;
	}

	public void setMsgType(String msgType) {
		this.msgType = msgType;
	}

	@Column(name="IS_READ", length=1)
	public String getIsRead() {
		return this.isRead;
	}

	public void setIsRead(String isRead) {
		this.isRead = isRead;
	}

	@Column(name = "READ_TIME")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getReadTime() {
		return this.readTime;
	}

	public void setReadTime(Date readTime) {
		this.readTime = readTime;
	}

	@Column(name="NOTE_NUM", length=10)
	public String getNoteNum() {
		return this.noteNum;
	}

	public void setNoteNum(String noteNum) {
		this.noteNum = noteNum;
	}

	@Column(name="NOTE_NUMS", length=10)
	public String getNoteNums() {
		return this.noteNums;
	}

	public void setNoteNums(String noteNums) {
		this.noteNums = noteNums;
	}

	@Column(name="NOTE_AT_TIME", length=10)
	public String getNoteAtTime() {
		return this.noteAtTime;
	}

	public void setNoteAtTime(String noteAtTime) {
		this.noteAtTime = noteAtTime;
	}

	@Column(name = "NOTE_TIME")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getNoteTime() {
		return this.noteTime;
	}

	public void setNoteTime(Date noteTime) {
		this.noteTime = noteTime;
	}

	@Column(name="EVENT_TYPE", length=1)
	public String getEventType() {
		return this.eventType;
	}

	public void setEventType(String eventType) {
		this.eventType = eventType;
	}

	@Column(name="IS_DELE", length=1)
	public String getIsDele() {
		return this.isDele;
	}

	public void setIsDele(String isDele) {
		this.isDele = isDele;
	}

	@Column(name="VERSION", length=10)
	public String getVersion() {
		return this.version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	
	@ManyToOne(cascade = { CascadeType.REFRESH }, fetch = FetchType.EAGER)
	@JoinColumn(name = "PER_CALL_ID")
	public TbOaPersonCall getTbPersonCall() {
		return tbPersonCall;
	}

	public void setTbPersonCall(TbOaPersonCall tbPersonCall) {
		this.tbPersonCall = tbPersonCall;
	}

	@Column(name="CALL_TYPE", length=1)
	public String getCallType() {
		return callType;
	}

	public void setCallType(String callType) {
		this.callType = callType;
	}

	@Column(name="IS_CORPER", length=1)
	public String getIsCorper() {
		return isCorper;
	}

	public void setIsCorper(String isCorper) {
		this.isCorper = isCorper;
	}

	@Column(name="MSG_MONTH", length=10)
	public String getMsgMonth() {
		return msgMonth;
	}

	public void setMsgMonth(String msgMonth) {
		this.msgMonth = msgMonth;
	}

	@Column(name="MSG_QUARTER", length=10)
	public String getMsgQuarter() {
		return msgQuarter;
	}

	public void setMsgQuarter(String msgQuarter) {
		this.msgQuarter = msgQuarter;
	}

	@Column(name="MSG_YEAR", length=10)
	public String getMsgYear() {
		return msgYear;
	}

	public void setMsgYear(String msgYear) {
		this.msgYear = msgYear;
	}

}